package com.object.module.cbb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.object.configuration.utils.PageUtils;
import com.object.configuration.utils.Q;
import com.object.configuration.utils.Query;
import com.object.dao.cbb.CbbPhotoAlbumDao;
import com.object.dao.cbb.SortNodeShopDao;
import com.object.module.cbb.entity.CbbPhotoAlbum;
import com.object.module.cbb.service.CbbPhotoAlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class CbbPhotoAlbumServiceImpl extends ServiceImpl<CbbPhotoAlbumDao, CbbPhotoAlbum> implements CbbPhotoAlbumService {
    @Autowired
    private SortNodeShopDao sortNodeShopDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CbbPhotoAlbum> page = this.page(
                new Query<CbbPhotoAlbum>().getPage(params),
                new QueryWrapper<CbbPhotoAlbum>()
        );

        return new PageUtils(page);
    }

    /**
     * 图片集查询相应的图片集
     *
     * @param igId
     * @return
     */
    @Override
    public Q infoPhotoAlbum(Integer igId) {
        CbbPhotoAlbum cbbPhotoAlbum = getById(igId);
        return Q.ok().put("cbbPhotoAlbum", cbbPhotoAlbum);
    }

}
